d = PyModule_GetDict(m);
xc_error = PyErr_NewException(XENPKG ".error", NULL, NULL);
PyDict_SetItemString(d, "error", xc_error);
+ PyDict_SetItemString(d, "VIRQ_DOM_EXC", PyInt_FromLong(VIRQ_DOM_EXC));
zero = PyInt_FromLong(0);
from messages import *
-VIRQ_MISDIRECT = 0 # Catch-all interrupt for unbound VIRQs.
-VIRQ_TIMER = 1 # Timebase update, and/or requested timeout.
-VIRQ_DEBUG = 2 # Request guest to dump debug info.
-VIRQ_CONSOLE = 3 # (DOM0) bytes received on emergency console.
-VIRQ_DOM_EXC = 4 # (DOM0) Exceptional event for some domain.
-
DEBUG = 0
RESPONSE_TIMEOUT = 20.0
def __init__(self):
"""Constructor - do not use. Use the channelFactory function."""
self.notifier = xu.notifier()
- # Register interest in all virqs.
- # Unfortunately virqs do not seem to be delivered.
- self.bind_virq(VIRQ_MISDIRECT)
- self.bind_virq(VIRQ_TIMER)
- self.bind_virq(VIRQ_DEBUG)
- self.bind_virq(VIRQ_CONSOLE)
- self.bind_virq(VIRQ_DOM_EXC)
+ # Register interest in virqs.
+ self.bind_virq(xen.lowlevel.xc.VIRQ_DOM_EXC)
self.virqHandler = None
def bind_virq(self, virq):
log.info("Virq %s on port %s", virq, port)
def virq(self):
+ log.error("virq")
self.notifier.virq_send(self.virqPort)
def start(self):
cc = (control_channel_t *)malloc(sizeof(control_channel_t));
if ( cc == NULL ) return NULL;
+ memset(cc, 0, sizeof(control_channel_t));
cc->type = CC_TYPE_VIRQ;
cc->local_port = virq_port;
cc->virq = virq;
+ cc->ref_count = 1;
+ if (evtchn_bind(cc->local_port) != 0)
+ {
+ DPRINTF("Got control interface, but couldn't bind evtchan!\n");
+ free(cc);
+ return NULL;
+ }
+
+ cc_list[cc->local_port] = cc;
+
return cc;
}